package com.ccx.coachsite.bus;

import android.app.Activity;
import android.content.Context;

import com.ccx.coachsite.http.BaseResp;
import com.ccx.coachsite.task.ReinfoTask;
import com.ccx.coachsite.ui.login.RegisterActivity;

public class ReinfoBus extends BaseBus {
	
	public ReinfoBus(Activity activity) {
		super(activity, "正在提交...");
		successInfo = "信息修改成功";
		errorInfo = "信息修改失败";
	}
	
	public ReinfoBus(Context context) {
		super(context);
		processInfo = "正在提交...";
		successInfo = "信息修改成功";
		errorInfo = "信息修改失败";
	}
	
	protected void onCallback(boolean isSucces, int taskType, BaseResp response, String responseJson)
	{
		if(isSucces)
		{
			if(mActivity != null && mActivity instanceof RegisterActivity)
			{
				RegisterActivity ra = (RegisterActivity)mActivity;
				ra.afterSuccess();
			}
		}
	}

	public void changeInfo(Account account, String filename) {
		showProgress();
		ReinfoTask task = new ReinfoTask(mContext,this, account, filename);
		task.execute();
	}
}
